/*
write by wuweiwei
Wing.js is write by wweiwei
*/
(function(win){
	var $ID = function(id){
		return document.getElementById(id);
	}
	/*
	Wing is global object
	*/
	var wRouter = Wing.wRouter;

	var wR = new wRouter({
		useHistory:false,
		servicePath:"microService" //这个参数告诉主服务加载的路径(微服务的子服务文件夹名)
	});          /*路由控制器组件*/

	var routerCfg = {
		container:document.getElementById("app"),
		routes:[
			{
				url:"/microService/service1",
				controller:"Service1",
				templateUrl:"serviceTpls/service1.html", /*载入模板到container指定的DOM里*/
				js:"/jsfile/App.Service1.js"
			},
			{
				url:"/microService/service2",
				controller:"Service2",
				templateUrl:"serviceTpls/service2.html",
				js:"/jsfile/App.Service2.js"
			}
		]
	}

	wR.config(routerCfg);

	wR.controller("Service1",function(args){
		App.Service1.init(args);
		console.log(this.location);/* this is location object*/
	});
	wR.controller("Service2",function(args){
		/*
		args is url :id object
		this args is "{id:2017111231}"
		*/
		App.Service2.init(args);
	});
	//wR.triggerRouter("Service1");
})(window);
